package com.kaigejava.iterator.conventional;

import com.kaigejava.iterator.MenuItem;

import java.util.ArrayList;

/**
 * Created by kaigejava on 2019/9/6.
 * 服务员对啊想
 */
public class Waitress {
    private CakeHouseMenu mCakeHouseMenu;
    private DinerMenu mDinerMenu;
    private ArrayList<MenuItem> cakeitems;
    private MenuItem[] dineritems;

    public Waitress() {
        mCakeHouseMenu = new CakeHouseMenu();
        cakeitems = mCakeHouseMenu.getMenuItems();
        mDinerMenu = new DinerMenu();
        dineritems = mDinerMenu.getMenuItems();
    }

    public void printMenu() {
        MenuItem menuItem;
        System.out.println("******* 早餐如下：********");
        for (int i = 0, len = cakeitems.size(); i < len; i++) {
            menuItem = cakeitems.get(i);
            System.out.println(menuItem.getName() + "***"
                    +menuItem.getPrice()+"***"+ menuItem.getDescription());

        }
        System.out.println("******* 午餐如下：********");
        for (int i = 0, len = mDinerMenu.numberOfItems; i < len; i++) {
            menuItem = dineritems[i];
            System.out.println(menuItem.getName() + "***"
                    +menuItem.getPrice()+"***"+ menuItem.getDescription());

        }

    }

    public void printBreakfastMenu() {

    }

    public void printLunchMenu() {

    }

    public void printVegetableMenu() {

    }
}
